package com.tqfframe.task.learning.threadStudy;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * @Author: 唐祺峰
 * @Date: 2020/9/10 0010 13:49
 * @Version 1.0
 */
public class ThreadPool {
    public static void main(String[] args) {
        int a=2<<5; //2的5次方=64
        System.out.println(a);
        ExecutorService executorService=Executors.newFixedThreadPool(10);
        int i=100;
        while (i-->0){
            executorService.execute(new TestThread());
        }
        executorService.shutdown();

    }

    public static class TestThread implements Runnable{

        @Override
        public void run() {
            try {
                Thread.sleep(2000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            System.out.println(Thread.currentThread()+"我是线程执行");
        }
    }
}
